import config from "@/config"
import http from "@/utils/request"

export default {
	// 故障
	hitch: {
		list: {
			url: `${config.API_URL}/hitch/list.do`,
			name: "我发起的故障申告",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		my: {
			url: `${config.API_URL}/hitch/my.do`,
			name: "我发起的故障申告",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		unit: {
			url: `${config.API_URL}/hitch/unit.do`,
			name: "我公司的故障申告",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		dispatch: {
			url: `${config.API_URL}/hitch/dispatch.do`,
			name: "待派单的故障申告",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		pending: {
			url: `${config.API_URL}/hitch/pending.do`,
			name: "待处理的故障申告",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		followup: {
			url: `${config.API_URL}/hitch/followup.do`,
			name: "待回访或已回访的故障申告",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/hitch/save.do`,
			name: "新增/修改",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		delete: {
			url: `${config.API_URL}/hitch/delete.do`,
			name: "删除",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		handle: {
			url: `${config.API_URL}/hitch/handle.do`,
			name: "处理",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		visit: {
			url: `${config.API_URL}/hitch/visit.do`,
			name: "回访记录",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		info: {
			url: `${config.API_URL}/hitch/get.do`,
			name: "删除",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
	},
	// 门店
	store: {
		list: {
			url: `${config.API_URL}/store/list.do`,
			name: "列表",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/store/save.do`,
			name: "新增/修改",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		delete: {
			url: `${config.API_URL}/store/delete.do`,
			name: "删除",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		info: {
			url: `${config.API_URL}/store/get.do`,
			name: "删除",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
	},
}